package com.mworld.galaxy.bull.repository.product;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.mworld.galaxy.bull.entity.product.Link;
import com.mworld.galaxy.bull.entity.product.LinkId;

public interface LinkDao extends PagingAndSortingRepository<Link, LinkId>, JpaSpecificationExecutor<Link> {
    @Modifying
    @Query("DELETE FROM Link link WHERE link.pk.category.id = ?1")
    void deleteCategoryLink(Long cid);

    // @Modifying
    // @Query("DELETE FROM Link link WHERE link.pk.category.level2Id = ?1")
    // void deleteLevel2CategoryLink(Long cid);

    // @Modifying
    // @Query("DELETE FROM Link link WHERE link.pk.category.level1Id = ?1")
    // void deleteLevel1CategoryLink(Long cid);
}
